package at.fhj.itm10.eventgallery.configuration;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;


public class Configuration {
	
	private static Configuration INSTANCE;
	private String serverUrl;
	private String eventName;
	private String uniqueEventUrl;
	
	public Configuration() {
		readConfigFile();
	}
	
	// read config file
	private void readConfigFile() {
		InputStream stream = getClass().getResourceAsStream("/at/fhj/itm10/eventgallery/configuration/configuration.properties");
		Properties config = new Properties();
		try {
			config.load(stream);
		} catch (IOException e) {
			e.printStackTrace();
		}
		this.serverUrl = config.getProperty("serverUrl");
	}

	public static Configuration getINSTANCE() {
		if (INSTANCE == null)
			INSTANCE = new Configuration();
		return INSTANCE;
	}
	public String getServerUrl() {
		return serverUrl;
	}
	public String getEventName() {
		return eventName;
	}
	public void setEventName(String eventName) {
		this.eventName = eventName;
	}
	public String getUniqueEventUrl() {
		return uniqueEventUrl;
	}
	public void setUniqueEventUrl(String uniqueEventString) {
		this.uniqueEventUrl = uniqueEventString;
	}
}
